import request from '@/utils/request';
import qs from 'qs';
// 环境管理模块接口
// 获取实时温度
export function getTempNow(query) {
  return request({
    url: '/environment/getTempHumidityByCurrentTime',
    method: 'POST',
    data: query
  });
}
// 获取当天温度
export function getTempDay(query) {
  return request({
    url: '/environment/getTempHumidityByIntegralPoint',
    method: 'POST',
    data: query
  });
}
// 获取历史温湿度
export function getTempPast(query) {
  return request({
    url: '/environment/getHistoryTempHumidityByPage',
    method: 'GET',
    params: query,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false });
    }
  });
}
// 获取温湿度列表
export function getTempList(query) {
  return request({
    url: '/environment/getTempHumidityTable',
    method: 'POST',
    params: query,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false });
    }
  });
}
// 获取温湿度折线图
export function getTempChart(query) {
  return request({
    url: '/environment/getHistoryTempHumidity',
    method: 'POST',
    data: query
  });
}
